package com.yoso.util;

import cn.hutool.core.io.resource.ResourceUtil;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.io.UrlResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.stereotype.Component;

import java.net.URL;
import java.util.List;
import java.util.Properties;

@Component
public class PropertiesLoader implements CommandLineRunner {

    /**
     * Callback used to run the bean.
     *
     * @param args incoming main method arguments
     * @throws Exception on error
     */
    @Override
    public void run(String... args) throws Exception {

        List<URL> resources = ResourceUtil.getResources("META-INF/spring.factories");
        URL url = ResourceUtil.getResource("author.properties");
        Properties properties = PropertiesLoaderUtils.loadProperties(new UrlResource(url));



    }

}
